package com.example.ck.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.ck.dao.ContractDao;
import com.example.ck.entity.Contract;
import com.example.ck.service.ContractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 合同表(Contract)表服务实现类
 *
 * @author makejava
 * @since 2024-05-15 10:07:07
 */
@Service("contractService")
public class ContractServiceImpl implements ContractService {

    @Autowired
    private ContractDao contractDao;

    /**
     * 招标商上传合同
     *
     * @param contract
     * @return
     */
    @Override
    public boolean addHt(Contract contract) {
        return contractDao.insert(contract) > 0;
    }

    @Override
    public Contract getHtByXmId(Integer projectId) {
        QueryWrapper qw = new QueryWrapper<>();
        qw.eq("project_id", projectId);
        return contractDao.selectOne(qw);
    }
}
